#!/bin/bash
#清空msc_sso_xxx_join_dinnertable_member表的数据
hosts='127.0.0.1'
users=root
passwds='123456'
dbname='test'
zonefile=/root/zone/zone.txt
logfile=/root/zone/jion_logs.txt
echo "---------------------------------------------------------" >> $logfile
echo $(date +"%y-%m-%d %H:%M:%S") >> $logfile
echo "---------------------------------" >> $logfile
for i in `cat $zonefile`
do
mysql -h $hosts  -u $users -p$passwds -e "delete from  ${dbname}.msc_sso_${i}join_dinnertable_member" > /dev/null 2>&1
if [[ $? -eq  0 ]];then
echo "`date '+%Y-%m-%d_%H.%M'`    OK    ${i}" >> ${logfile}
else
echo "`date '+%Y-%m-%d_%H.%M'`    Fail    ${i}" >>${logfile}
fi
done
